<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div style="text-align: center">
    <form>
        <label for="number">请输入整数</label>
        <%
            String s = request.getParameter("num");
            if (s == null) {
                s = "";
            }
        %>
        <input type="number" min="1" id="number" name="num" value="<%=s%>">
        <input type="submit" value="确认">
    </form>
    <%
        int num = Integer.parseInt(s.equals("") ? "0" : s);
        for (int i = 1; i <= num; i++) {
            for (int j = 1; j <= 1 + (i - 1) * 2; j++) {
                out.print('*');
            }
            out.print("<br/>");
        }
    %>
</div>
</body>
</html>
